﻿using System;
using System.IO;
using IWshRuntimeLibrary;

namespace DestopIcon
{
    public class ShellIconManager
    {
        public static void CreateDesktopLnk()
        {
            string desktopPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
            WshShell shell = new WshShellClass();


            IWshShortcut shortcut = (IWshShortcut)shell.CreateShortcut(Path.Combine(desktopPath, "ERP系统.lnk"));

            shortcut.TargetPath = @"D:\software\cmpc\zy.exe";
            shortcut.Arguments = "";
            shortcut.Description = "ERP系统";
            shortcut.WorkingDirectory = @"D:\software\cmpc\";
            shortcut.IconLocation = @"D:\software\cmpc\zy.exe,0";
            shortcut.Hotkey = "CTRL+SHIFT+Z";
            shortcut.WindowStyle = 1;
            shortcut.Save();
        }
    }
}
